<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<c:set var="reportTitle" value="维修单报表" />

<%@ include file="/common/report_head.jsp" %>
<%@ include file="/condition/sartTime_input.html"%>
<%@ include file="/condition/endTime_input.html"%>
<%@ include file="/condition/fab_sumo.html"%>
<%@ include file="/condition/line_sumo.html"%>
<%@ include file="/condition/toolg_sumo.html"%>
<%@ include file="/condition/toolType_radio.html"%>
<%@ include file="/condition/tool_sumo.html"%>

<%@ include file="/common/report_middle.jsp" %>
<div class="col-md-12" style="height: 820px;">
    <div id="pqGrid"></div>
</div>
<%@include file="/common/report_end.jsp" %>


<script>
    $(document).ready(function () {
        $("title").text("维修单报表");

        $('#query_btn').click(function (){
            initGridAndChart();
            ajax('/jn-report/report/repairOrder_report.do' ,loadConditionMapData(), true, ajax_successful);

            function ajax_successful(outTrxObj) {
                if(outTrxObj.gridData.length < 1) { showMessengerDialog("数据查询为空"); return false; }

                //grid表格数据
                var colM = [
                    {halign:"center",align:'center', dataIndx: 'repair_order_id',	    title: '维修单号      ',    width: 120,    editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'fab_id',		        title: '厂别            ',	width: 140,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'line_id',	            title: '线别           ',	width: 140,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'tool_id',	            title: '设备           ',	width: 190,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'repair_stat',	        title: '维修状态          ',	width: 90,    editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'error_dsc',		        title: '故障描述',	        width: 260,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'error_analysis',	    title: '故障分析       ',	width: 260,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'repair_dsc',	        title: '解决方法        ',	width: 240,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'repair_result',	        title: '解决结果        ',	width: 90,    editable: false, sortable: true},
                    //{halign:"center",align:'center', dataIndx: 'eqt_confirmer',	        title: '设备确认人        ',	width: 100,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'eqt_confirmer_name',    title: '设备确认人        ',	width: 100,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'assistants',	        title: '协助人           ',	width: 100,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'responsible_usr_name',  title: '维修负责人 ',	    width: 100,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'qa_confirmer_name',	    title: '质量确认人    ',	    width: 100,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'pro_confirmer_name',    title: '生产确认人   ',	    width: 100,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'is_down',		        title: '是否停机          ',	width: 90,    editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'downtime',		        title: '停机时间        ',	width: 90,    editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'come_from',		        title: '维修单来源       ',	width: 95,    editable: false, sortable: true},
                    //{halign:"center",align:'center', dataIndx: 'last_deal',		        title: '转单人            ',	width: 100,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'last_deal_name',        title: '转单人            ',	width: 100,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'last_time',		        title: '转单时间       ',	width: 190,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'begin_timestamp',	    title: '维修开始时间      ',	width: 190,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'end_timestamp',	        title: '维修结束时间    ',	width: 190,   editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'keep_time',		        title: '耗时(分钟)        ',	width: 80,    editable: false, sortable: true}
                ];
                _pqUtil.f.setColModel($("#pqGrid"), colM);
                _pqUtil.f.seTitle($("#pqGrid"), outTrxObj.gridTitle);
                _pqUtil.f.loadPqGridData($("#pqGrid"), outTrxObj.gridData);
            };
        });
    });
</script>
